const percent = require('./percent');
const $ = require('jquery');
const rand = require('./rand');
//获取元素
let btn = document.querySelector("button");

btn.onclick = function(){
    if(percent(30)){
        alert('恭喜恭喜');
    }else{
        alert('醒醒吧!!');
    }
}
//点击按钮, 修改背景颜色
$('.bg').on('click', function(){
    $('body').css('background', `rgb(${rand(200, 255)},${rand(200, 255)}, ${rand(200,255)})`);
})